	IDENTIFICATION DIVISION.
	PROGRAM-ID. OVERTIMEWAGE.
	ENVIRONMENT DIVISION.
	INPUT-OUTPUT SECTION.
	FILE-CONTROL.
	    SELECT IN-FILE   ASSIGN TO DISK.
	DATA DIVISION.
	FILE SECTION.
	FD IN-FILE
	   LABEL RECORD STANDARD
	   VALUE OF FILE-ID IS "WAGE.DBF".
	01  IN-REC.
	    02 ID-NO   PIC 9(5).
	    02 RATE    PIC 9(3).
	    02 HOURS   PIC 9(2).
	WORKING-STORAGE SECTION.
	77  CH      PIC X.
	77  C       PIC 9 VALUE IS 0.
	77  NUM     PIC 99.
	77  TEMP1   PIC 9(6).
	77  TOTAL   PIC 9(6).
	77  D-ID    PIC Z(5).
	77  D-RATE  PIC Z(3).
	77  D-HR    PIC Z(2).
	77  D-TOT   PIC Z(6).
	
	PROCEDURE DIVISION.
	MAINPARA.
	    IF NOT C = 4 GO TO MENU.
	    STOP RUN.
	    
	NEW-FILE.    
	    DISPLAY "FILE CLEARED FOR INPUT ".
	    OPEN OUTPUT IN-FILE.
	    CLOSE IN-FILE.
	    GO TO MAINPARA.
	
	WRITEPARA.
	    OPEN EXTEND IN-FILE.
	    DISPLAY (1, 1) ERASE.
	    DISPLAY "--- DATA ENTRY ---".
	    GO TO NEWREC.
	
 
	NEWREC.    
	    DISPLAY (LIN, COL) "IDENTITY NO  : ". 
	    ACCEPT ID-NO.
	    DISPLAY (LIN, COL) "HOURLY RATE  : ". 
	    ACCEPT RATE.
	    DISPLAY (LIN, COL) "HOURS WORKED PER WEEK : ". 
	    ACCEPT HOURS.
	    
	    WRITE IN-REC.
	    DISPLAY (LIN, COL) "CONTINUE <Y/N>?: ".
	    ACCEPT CH.
	    DISPLAY " ".
	    IF CH = "Y" GO TO NEWREC.
	    CLOSE IN-FILE.
	    GO TO MAINPARA.
	
	MENU.
	    DISPLAY (1, 1) ERASE.
	    DISPLAY " ".
	    DISPLAY "------- MENU --------".
	    DISPLAY " ".
	    DISPLAY " 1. CREATE NEW FILE".
	    DISPLAY " 2. ADD RECORDS".
	    DISPLAY " 3. REPORT".
	    DISPLAY " 4. EXIT ".
	    DISPLAY " ".
	    DISPLAY (LIN, COL) "CHOICE : ".
	    ACCEPT C.
	    IF C = 1  GO TO NEW-FILE.
	    IF C = 2  GO TO WRITEPARA.
	    IF C = 3  GO TO OUTPARA.
	    GO TO MAINPARA.
	
	READREC.
	    OPEN INPUT IN-FILE.
	    GO TO READING.
	READING.
	    READ IN-FILE AT END GO TO DISPARA.
	    IF HOURS > 48  COMPUTE NUM = HOURS - 48
		COMPUTE TEMP1 = NUM * 2 * RATE
		COMPUTE TOTAL = 48 * RATE + TEMP1
	    ELSE COMPUTE TOTAL = HOURS * RATE.
	    
	    MOVE ID-NO TO D-ID MOVE  RATE TO D-RATE.
	    MOVE HOURS TO D-HR MOVE TOTAL TO D-TOT.
	    
	    DISPLAY  D-ID, "   ", D-RATE, "        " D-HR, 
					   "         ", D-TOT.

	    GO TO READING.

	OUTPARA.
	    DISPLAY (1, 1) ERASE.
	    DISPLAY "------------------------------------".
	    DISPLAY "               REPORT               ".
	    DISPLAY "------------------------------------".
	    DISPLAY " ID-NO  RATE   WEEKLY-HOURS    WAGE ".
	    DISPLAY "------------------------------------".
	    GO TO READREC.
	
	DISPARA.
	    CLOSE IN-FILE.
	    DISPLAY "------------------------------------".
	    ACCEPT C.
	    GO TO MAINPARA.



